package com.aimei.www.modules.exceptionHandel;

import com.aimei.www.modules.exception.AimeiException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/*
@ControllerAdvice
*/
@ResponseBody
public class AimeiExceptionHandel {

       /*@ExceptionHandler(AimeiException.class)*/
       public Map aimeiExceptionHandler(Exception e) {
              Map map = new HashMap();
              map.put("code", e.getMessage());
              map.put("code", 111);
              return map;
       }
}
